package cc.vv.btpartyjob.partymanager.delegate

import android.text.TextUtils
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import cc.vv.baselibrary.view.BaseTopBarView
import cc.vv.btpartyjob.jnimodule.moudel.bean.OrgDetailAdminObj
import cc.vv.btpartyjob.partymanager.R
import cc.vv.btpartyjob.partymanager.moudel.bean.TeamMemberBean
import cc.vv.btpartyjob.partymanager.view.ManagerPersonView
import cc.vv.btpartyjob.partymanager.view.MemberPrincipalView
import cc.vv.mvp.delegate.BaseAppDelegate
import java.util.*

/**
 * 街道联席会议简介托管类
 * Created by Chen.qi on 2018/10/24.
 */
class StreetMeetingJianJieIntroActivityDelegate : BaseAppDelegate() {

    override fun initWidget() {

    }

    override fun initLayoutRes(): Int {
        return R.layout.activity_organization_intro
    }

    /**设置标题title*/
    fun setTopBarTitle(topBarTitle: String) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_aoi_topBar)
        titleBar?.setTitle(topBarTitle)
    }


    /**设置标题右边按钮点击事件*/
    fun setTitleBackBtnOnClick(event: BaseTopBarView.EventInterface) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_aoi_topBar)
        titleBar?.setEventInterface(event)
    }

    /**
     * 管理员数据
     */
    fun setPrincipalData(adminList: ArrayList<OrgDetailAdminObj>?) {
        getView<ManagerPersonView>(R.id.mv_aoi_managerPersonView)?.addAllSelectedFileView(adminList)
    }


    /**
     * 设置单位名称
     */
    fun setUnitName(str: String?) {
        val viewStr = getView<TextView>(R.id.tv_aoi_unitName)
        viewStr?.text = str
    }

    /**
     * 设置联系方式
     */
    fun setUnitPhone(str: String?) {
        val viewStr = getView<TextView>(R.id.tv_aoi_unitTelPhone)
        viewStr?.text = str
    }

    /**
     * 设置地址
     */
    fun setUnitAddress(str: String?) {
        val viewStr = getView<TextView>(R.id.tv_aoi_address)
        val viewLLAdd = getView<LinearLayout>(R.id.ll_aoi_address)
        if (TextUtils.isEmpty(str)) {
            viewLLAdd?.visibility = View.GONE
        } else {
            viewLLAdd?.visibility = View.VISIBLE
            viewStr?.text = str
        }
    }

    /**
     * 设置邮编
     */
    fun setUnitCode(str: String?) {
        val viewStr = getView<TextView>(R.id.tv_aoi_unitCode)
        viewStr?.text = str
    }


}